﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<Style x:Key="CheckBoxStyle" TargetType="{x:Type CheckBox}">
		<Setter Property="SnapsToDevicePixels" Value="true"/>
		<Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}"/>
		<Setter Property="Background" Value="{DynamicResource NormalBrush}"/>
		<Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
		<Setter Property="Template" Value="{DynamicResource CheckBoxControlTemplate}"/>
	</Style>
	<ControlTemplate x:Key="CheckBoxControlTemplate" TargetType="{x:Type CheckBox}">
					
		<!-- BulletDecorator is used to provide baseline alignment between the checkmark and the Content -->
		<BulletDecorator Background="Transparent">
			<BulletDecorator.Bullet>
				<Grid Width="13" Height="13">
					<Border x:Name="Border" BorderThickness="{DynamicResource ThicknessSize_1}" Background="{DynamicResource BrushControlBackgroundLight}" BorderBrush="{DynamicResource ImpassiveColor4}" CornerRadius="{DynamicResource CornerRadiusSmall}"/>
					<Path x:Name="CheckMark" Stroke="{DynamicResource GlyphBrush}" StrokeThickness="2" SnapsToDevicePixels="False" Data="M 0 0 L 13 13 M 0 13 L 13 0"/>
				</Grid>
			</BulletDecorator.Bullet>
			<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
		</BulletDecorator>
					
		<!-- This uses Visibility to hide and show the CheckMark on IsChecked -->
		<ControlTemplate.Triggers>
			<Trigger Property="IsChecked" Value="false">
				<Setter Property="Visibility" Value="Collapsed" TargetName="CheckMark"/>
			</Trigger>
			<Trigger Property="IsMouseOver" Value="true">
				<Setter Property="Background" Value="{DynamicResource MouseOverBrush}" TargetName="Border"/>
			</Trigger>
			<Trigger Property="IsPressed" Value="true">
				<Setter Property="Background" Value="{DynamicResource PressedBrush}" TargetName="Border"/>
				<Setter Property="BorderBrush" Value="{DynamicResource PressedBorderBrush}" TargetName="Border"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
				<Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
			</Trigger>
		</ControlTemplate.Triggers>
					
	</ControlTemplate>
	<!-- Resource dictionary entries should be defined here. -->
</ResourceDictionary>